added SSCLI 1.0
[windows-sources.git] / shared source / sscli20 / tools / nmake / def.mak
blob68e1d6ad5a15bec2478c50815622008a785358cb
1 # ==++==
2 #
3 #
4 # Copyright (c) 2006 Microsoft Corporation. All rights reserved.
5 #
6 # The use and distribution terms for this software are contained in the file
7 # named license.txt, which can be found in the root of this distribution.
8 # By using this software in any fashion, you are agreeing to be bound by the
9 # terms of this license.
11 # You must not remove this notice, or any other, from this software.
14 # ==--==
15 #########################################################################
17 # M A C R O N O T E S
19 # -----------------------------------------------------------------------------
21 # ENV_CFLAGS The additional CFLAGS.
23 # MESSAGE_FILE Specifies the name of the text file which stores NMAKE's
24 # error messages.
26 ###############################################################################
28 ####################
29 # #
30 # Error checks ... #
31 # #
32 ####################
34 !ifndef INCLUDE
35 ! error INCLUDE environment variable not defined
36 !endif
38 !ifndef LIB
39 ! error LIB environment variable not defined
40 !endif
43 # LANGAPI directory
45 !ifndef LANGAPI
46 LANGAPI = \langapi
47 !endif
50 # Set default VER
52 !ifdef RELEASE
53 VER=release
54 RCFLAGS=-D_SHIP
55 !endif
57 !ifndef VER
58 VER=debug
59 !endif
62 # Validate VER
64 !if "$(VER)" != "debug"
65 !if "$(VER)" != "release"
66 !error VER env var has bad value '$(VER)', use lower case 'debug/release'
67 !endif
68 !endif
70 ####################
71 # #
72 # Macro Constants #
73 # #
74 ####################
76 !if ("$(NOPCH)" != "1") && ("$(LTCG_BUILD)" != "1")
77 PCH = -YX -Fp$(OBJDIR)\nmake.pch
78 !endif
80 ###########################################
81 # #
82 # Version and TARGET dependent macros ... #
83 # #
84 ###########################################
86 # message file
87 MESSAGE_FILE = nmmsg.us
89 !ifdef KANJI
90 CLM = /DKANJI
91 !endif
93 !ifdef NT
94 ECHO =
95 !endif
97 !if "$(VER)" == "debug"
98 KEEP = keep
99 !endif
101 LINKER = link
103 ##############################
105 # Macro Dependent macros ... #
107 ##############################
109 CFLAGS = $(CFLAGS) $(CLM) /DNO_OPTION_Z /Fd$(OBJDIR)\nmake.pdb
110 CFLAGS = $(CFLAGS) /Gf /Gy /I$(LANGAPI)\include /nologo /W3
112 !if ("$(NOPCH)" != "1") && ("$(LTCG_BUILD)" != "1")
113 CFLAGS = $(CFLAGS) /Fp$(OBJDIR)\nmake.pch /YXgrammar.h
114 !endif
116 !if "$(LTCG_BUILD)" == "1"
117 CFLAGS = $(CFLAGS) /GL
118 !endif
120 !if "$(DBC)" != "0"
121 CFLAGS = $(CFLAGS) /D_MBCS
122 !message --- building _MBCS version
123 !endif
125 !if "$(VER)" == "debug"
127 CFLAGS = $(CFLAGS) /Gz /MDd /Od /Zi
129 !else # Release version
131 CFLAGS = $(CFLAGS) /Gz /DNDEBUG /MD /O2 /Zi
133 !endif
135 !ifdef BROWSE
136 CFLAGS = $(CFLAGS) /FR$(OBJDIR)^\
137 !endif
139 !if "$(PROCESSOR_ARCHITECTURE)" == "x86"
140 CFLAGS = $(CFLAGS) -DWIN95
141 !endif
143 !if "$(PROCESSOR_ARCHITECTURE)" == "IA64"
144 CFLAGS = $(CFLAGS) -Wp64
145 !endif
148 #############################
150 # Creating Object directory #
152 #############################
154 OBJDIR = $(VER)$(_OD_EXT)
157 !if [cd $(VER)$(_OD_EXT)]
158 ! if [md $(VER)$(_OD_EXT)]
159 ! error Failed creating $(VER)$(_OD_EXT) directory!
160 ! else if [cd $(VER)$(_OD_EXT)]
161 ! error Failed cd to $(VER)$(_OD_EXT) directory!
162 ! endif
163 !endif
165 !if [cd $(MAKEDIR)]
166 ! error Failed cd to $(MAKEDIR) directory!
167 !endif
169 ##############################
171 # Setting up inference rules #
173 ##############################
175 # Clear the Suffix list
177 .SUFFIXES:
179 # Set the list
181 .SUFFIXES: .cpp .rc
183 # The inference rules used are
185 .cpp{$(OBJDIR)}.obj::
186 $(CC) $(CFLAGS) /c /Fo$(OBJDIR)/ $<
188 .rc{$(OBJDIR)}.res:
189 rc $(RCFLAGS) -I$(LANGAPI)\include -I$(OBJDIR) -Fo$@ $<
191 ###############################
193 # Echoing useful information #
195 ###############################
198 !ifdef INFO
199 !message VER = "$(VER)"
200 !message CC = "$(CC)"
201 !message LINKER = "$(LINKER)"
202 !message OBJDIR = "$(OBJDIR)"
203 !message CFLAGS = "$(CFLAGS)"
204 !message
205 !message PATH = "$(PATH)"
206 !message INCLUDE = "$(INCLUDE)"
207 !message LIB = "$(LIB)"
208 !message
209 !endif
212 #################################
214 # Providing help about building #
216 #################################
218 !if "$(HELP)" == "build"
219 help:
220 @type <<
221 Define the VER environment variable to tell NMAKE what version to build.
222 The possible values for VER are 'debug' and 'release'.
223 The object files are always built with /Zi
224 option. This is done to make it just a matter of linking when debugging. The
225 'retail' and 'cvinfo' versions differ in only that codeview information has
226 been added. For the 'retail' version the asserts are removed.
227 To see information about what is being built define INFO.
228 You can define LOGO to see the compiler logo and
229 define ECHO to see the command actually passed to the compiler. The switches
230 passed to the compiler can be changed from the command line by defining the
231 corresponding switches used in def.mak.
233 !endif